﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Photo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            radioButton1.Checked = true;
            button1.Enabled = false;
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            textBox1.Focus();
            label3.Text = "";
            textBox1.Text = "";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double price = 0;
            int n;
            double sum;
            if (radioButton1.Checked)
                price = 8.50;
            if (radioButton2.Checked)
                price = 10;
            if (radioButton3.Checked)
                price = 15.5;
            n = Convert.ToInt32(textBox1.Text);
            sum = price * n;
            label3.Text = "Price: " + price.ToString("c") + "\nAmount: " + n.ToString() + "br. \n" +
                "Order Total: " + sum.ToString("C");
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0)
                button1.Enabled = false;
            else
                button1.Enabled = true;
            label3.Text = "";
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            textBox1.Focus();
            label3.Text = "";
            textBox1.Text = "";
        }
        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            textBox1.Focus();
            label3.Text = "";
            textBox1.Text = "";
        }
    }
}
